﻿@using System.Linq

@{
    int folder = 0;
    if (HttpContext.Current != null)
    {
        if (HttpContext.Current.Request.RawUrl.ToLower().Contains("inbox"))
        { 
            folder = 1;
        }
        else if (HttpContext.Current.Request.RawUrl.ToLower().Contains("outbox"))
        {
            folder = 2;
        }
    }    
}
<table>
    <tr>
        <td style="padding-right:30px"><a href="/">@Html.Raw(folder == 0 ? "<b>All documents</b>" : "All documents")</a></td>
        <td style="padding-right: 30px"><a href="/Document/Inbox">@Html.Raw(folder == 1 ? "<b>Inbox</b>" : "Inbox")</a></td>
        <td style="padding-right: 30px"><a href="/Document/Outbox">@Html.Raw(folder == 2 ? "<b>Outbox</b>" : "Outbox")</a></td>
        <td style="padding-right: 30px">|</td>
        <td style="padding-right: 30px;"><a style="color: FFCC66" href="javascript:ReCalcInbox()">Calculating inbox</a></td>
        <td style="padding-right: 30px">|</td>
        <td style="padding-right: 30px;"><a href="@Url.Action("Index", "LoadTesting")">Load testing</a></td>
</tr>
</table>

<script>
    function ReCalcInbox() {
        $.ajax({
            type: "POST",
            url: "@Url.Action("RecalcInbox", "Document")",
            success: function (msg) {
                alert(msg);
            }
        });
    }

</script>